package Month11.Day8;

import java.util.LinkedList;

public class LinkedListTest {
    public static void main(String[] args) {
        LinkedList<Integer> linkedList=new LinkedList<>();
        Long start=System.currentTimeMillis();
        for (int i = 0; i < 100000; i++) {
            linkedList.add(i);
        }
        System.out.println("加入对象共计耗时：" + start);

        for (Integer integer : linkedList)
            System.out.println(integer);
        Integer o = 0;
        for (int j = 0; j < 100; j++) {
            o = (int) (Math.random()*100000);
            linkedList.remove(o);
            System.out.println(o);
        }
        Long finish=System.currentTimeMillis();
        System.out.println("删除随机100个数的时间为："+(finish-start));
        System.out.println(linkedList);

    }

}
